package com.zwj.controller;


import com.zwj.dto.Result;
import com.zwj.entity.CourseResourcesEntity;
import com.zwj.entity.SysMenuEntity;
import com.zwj.service.CourseResourcesService;
import com.zwj.service.SysMenuService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zwj
 * @since 2021-11-02
 */
@RestController
@RequestMapping("/course-resources-entity")
public class CourseResourcesController {

    private final CourseResourcesService courseResourcesService;

    public CourseResourcesController(CourseResourcesService courseResourcesService) {
        this.courseResourcesService = courseResourcesService;
    }

    @ApiOperation(value = "添加资料", notes = "添加资料")
    @PostMapping("/addResources")
    public Result addResources(@RequestBody CourseResourcesEntity courseResourcesEntity) {
        return courseResourcesService.addResources(courseResourcesEntity);
    }

    @ApiOperation(value = "审批资料", notes = "审批资料")
    @PostMapping("/updateResources")
    public Result updateResources(@RequestBody CourseResourcesEntity courseResourcesEntity) {
        return courseResourcesService.updateStatus(courseResourcesEntity);
    }

}

